<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
    <div class="box">
        <!-- 第三步：使用组件 -->
        <school></school>
        <hr>
        <school></school>
        
    </div>
</body>
<script>
    //第一步：创建组件
    const school = Vue.extend({
        template:`
        <div>
            <h3>学校名称：{{name}}</h3>
            <h3>学校地址：{{addr}}</h3>
        </div>
        `,
        data() {
            return {
                name:'atguigu',
                addr:'北京'
            }
        },
    })

    new Vue({
        el:'.box',
        //第二步：注册组件
        components:{
            school:school,
        }
    })
</script>
</html>